home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / text / hints / volume_03 / issue_01 next >
Text File  |  1995-02-16  |  11KB  |  308 lines

  1. •   Acorn DTP fonts and print outs − P.J.Burn says that in order to
  2. print out Acorn DTP documents on an A310 you should select mode 11 as
  3. this releases 40k of memory. He also says that in order to increase the
  4. speed of the DTP screen update you should ensure that the font cache is
  5. 24k or larger.
  6. 3.1
  7. •   Acorn DTP double spacing − Some readers have complained that when
  8. starting a new paragraph the Acorn DTP will always produce a double
  9. space. This can be solved by altering the space above setting of the
  10. paragraph’s style.
  11. 3.1
  12. •   BASIC listings for !Edit − Mark Taylor says that it is easy to
  13. create an ASCII copy of a BASIC program. Just install !Edit in the
  14. normal way and then create a task window (this can be done by clicking
  15. the MENU button on the !Edit icon and selecting the ‘New task window’
  16. item from the ‘Create’ sub-menu). In this window start BASIC by typing
  17. *BASIC, then just LOAD the required program and LIST it. You can now
  18. save the contents of the window  as a normal ASCII file.
  19. 3.1
  20. •   C operating system calls (issue 2.12 p 36 cont) − Ray Loades-Bannon
  21. says that to access OSCLI commands from C you should use either:
  22. 3.1
  23. system (“screensave <pathname>””)
  24. 3.1
  25. or:
  26. 3.1
  27. {3 .1
  28.    char *cptr;
  29. 3.1
  30.    strcpy (cptr,“screensave ”);
  31. 3.1
  32.    strcat(cptr,pathnameptr);
  33. 3.1
  34.    system(cptr);
  35. 3.1
  36. }
  37. 3.1
  38. See the ‘Calling other programs from C’ chapter in the C manual for
  39. further details.
  40. 3.1
  41. •   Debugger BreakPoints − When stepping though code, it is useful to
  42. run the code up to a breakpoint, and then remove the breakpoint and
  43. reposition it further ahead. Here are three function keys defin-itions
  44. suggested by Robin Terry to help you do this:
  45. 3.1
  46. *Key1 “BreakClr PC|MBreakSet ”
  47. 3.1
  48. *Key2 “Continue|M”
  49. 3.1
  50. *Key3 “MemoryI PC|M”
  51. 3.1
  52. The first breakpoint is set by using *BreakSet, but subsequent break
  53. points can be set by pressing <f1> and typing in the address. Then press
  54. <f2> should be pressed to execute the code , and <f3> should be pressed
  55. to look at where you’ve got to.
  56. 3.1
  57. •   Droom under RISC-OS − A.H.Eagle says that when using Droom under
  58. RISC-OS the $.Data.Map program just caused the computer to freeze at
  59. line 820. This line reads 820 ?&CFF=L, and doesn’t seem to serve any
  60. purpose (perhaps it is a hang-over from the BBC version). He removed
  61. this line and the program now seems to work OK ( ... so far!).
  62. 3.1
  63. •   Econet and the Desktop − A warning to all people using the desktop
  64. on the network: *commands are truncated to about 80 characters by the
  65. NetFiler, so for example, if you are several directories down and you
  66. rename a file, it could be renamed to something that you didn’t quite
  67. expect. More dangerous is the *Delete, in that you could want to *delete
  68. net#254:<pathname>.FredOld  but your good copy is deleted when the
  69. command is truncated to *delete net#254:<pathname>.Fred. Truncation
  70. occurs due to the Acorn fileservers only being able to cope with data
  71. packets of around 80 characters (although the SJ Research fileserver can
  72. handle packets up to 128 characters). Another interesting feature is
  73. that if the *command is over 128 characters, no truncation occurs and a
  74. Net error is generated.
  75. 3.1
  76. •   Filer_OpenDir revisited (issue 2.12 p 6 cont) − A simpler way of
  77. using system variables with the *Filer_OpenDir command has been
  78. suggested by one of the Archive BBS callers:
  79. 3.1
  80. *Set Alias$temp Filer_OpenDir <system variable>|MUnset Alias$temp|M
  81. 3.1
  82. *temp
  83. 3.1
  84. This sets up a system variable, called Alias$temp, which is used to
  85. expand the system variable and then delete itself once called.
  86. 3.1
  87. •   Hard Disc Backup program on Careware 3 − Terry Bromilow says: “The
  88. program was originally written to run under Arthur OS using the D or L
  89. format discs. I put a new front end on it to make an application for
  90. RISC-OS and put in some lines to accommodate E format discs. It is now
  91. evident that the latter did not get tested.
  92. 3.1
  93. The BASIC program !Hdb_v200 in the !HDBackup directory should be amended
  94. as follows:-
  95. 3.1
  96. Interchange the adjacent lines 2140 and 2150 and put a new line between
  97. them: 2141 *DISMOUNT
  98. 3.1
  99. •   Hard disc parking (2.11 p 13 cont) − Martyn Lovell says that
  100. although *bye from a non-adfs filing system won’t park an adfs hard disc
  101. *adfs:bye will (SCSI hard drive owners should use *scsi:bye).
  102. 3.1
  103. •   Keyboard condensation − One reader has noted that there is no
  104. lacquer on the top surface of the keyboard PCB. It is not unusual for
  105. people to blow dust, etc away from the keyboard, however, this will
  106. cause condensation onto the PCB and cause some minor corrosion. This can
  107. easily be wiped away.
  108. 3.1
  109. •   Limited ADFS memory error − The ADFS module will remember the
  110. catalogues of any discs it sees (e.g. those that it *mounts). However,
  111. it is limited to the amount of memory it can allocate to ‘remembering’
  112. these catalogues. This is governed by the *Configure ADFSDirCache
  113. command. When the ADFS directory cache is full, the oldest catalogues
  114. should be discarded as new ones are encountered. Unfortunately, the 
  115. module has a bug, which prevents it from doing this properly. What makes
  116. this bug so serious is that it can cause the dreaded ‘Filecore in use’
  117. error, which cannot be rectified, thereby making it impossible for you
  118. to save any data, etc that you might have been working on. (If Phil
  119. Colmer at Acorn, or whoever, could give us a clue on this one, that
  120. would be useful. Ed.)
  121. 3.1
  122. •   Naming discs − You may already realise that you should not give
  123. discs the same name (using the *NameDisc command) as RISC-OS will only
  124. access one of the discs i.e. the one most recently *MOUNTed. David
  125. Leckie found that this also holds up for fileservers discs. He had two
  126. separate fileservers 254 and 245 both with hard disks called FS, as you
  127. can imagine this cause much confusion!
  128. 3.1
  129. •   Obey module bug − “Speak and I shall obey ... or maybe not.” There
  130. is a bug in the obey module supplied in the ROMS (v0.07). If an
  131. environment variable is set to a string ending with the tilde character
  132. (~) then the string will magically acquire a few extra characters, or
  133. worse.
  134. 3.1
  135. Using Edit, create a new obey file containing the command:
  136. 3.1
  137. Set testvariable abcdef~
  138. 3.1
  139. or similar, ensuring that the <return> key is pressed immediately after
  140. the tilde (~). Save the file to a directory window and then double click
  141. on the file icon to run the file. This will create the variable
  142. “testvariable”. Press <f12> to get a system prompt and type
  143. 3.1
  144. Show testvariable
  145. 3.1
  146. to display the variable’s value. It will show some-thing like
  147. 3.1
  148. testvariable : abcdef~~&’
  149. 3.1
  150. i.e. it has acquired a few extra characters. (N.B. I’ve been unable to
  151. repeat (see below) this so the characters may be wrong − but I do know
  152. where they originate from so this is an educated guess)
  153. 3.1
  154. Worse is that depending on the exact situation when the file is run an
  155. “Abort on Data Transfer” error may occur (!!) and the variable will not
  156. have been created.
  157. 3.1
  158. The problem is easily solved − don’t try and create a string ending with
  159. ~ in an obey file. If necessary a space can be placed after the tilde
  160. (~) and this will be enough to prevent the error. Clifford Hoggarth
  161. 3.1
  162. •   RAM disc size − To read the size of a RAM disc, not *configured but
  163. set from within the desktop task manager you should use:
  164. 3.1
  165. SYS “OS_ReadRAMFsLimits” TO A,B
  166. 3.1
  167. (B-A)/1024 gives the size of the the RAM disc in kbytes.
  168. 3.1
  169. To check if a *configured ram disc exists then try:
  170. 3.1
  171. SYS “OS_Byte”,161,144 To ,,ramdiscsize%
  172. 3.1
  173. The variable ramdiscsize% indicates the number of RAM pages to be
  174. allocated to the RAM disc e.g. 8k blocks for a 300 series.
  175. 3.1
  176. •   Recursive directory copying − If you copy a directory into itself
  177. (as Clive Payne did with his library directory in issue 2.11 p 15) the
  178. computer will get into an infinite loop of copying directories inside of
  179. themselves. To stop the computer from using all your disc space up, you
  180. can press the escape key. The error can then be rectified by going into
  181. the parent directory and deleting its children i.e. you don’t have to
  182. reformat your disc!
  183. 3.1
  184. •   ROM Speed Up − In several Archive issues (e.g. issue 2.11 p 8) we
  185. have pointed out that the speed at which the Archimedes runs its ROMs
  186. can be increased. Martyn Lovell advises us that this can cause RISC-OS
  187. to crash and so is not very reliable.
  188. 3.1
  189. •   Squish − I am very pleased with Mike Harrison’s “SQUISH” program (on
  190. Careware disc 2). It enables me to write meaningful, well laid out
  191. programs and then to gain processing speed following compression.
  192. Brilliant!
  193. 3.1
  194. I have, however, discovered a bug. This occurs whenever you use a
  195. statement such as:
  196. 3.1
  197. IF a=b c=d
  198. 3.1
  199. What actually happens is that it compresses to:
  200. 3.1
  201. IF a=bc=d
  202. 3.1
  203. The program then fails “Unknown or missing variable”. To circumvent
  204. this, the full construct IF ... THEN ... should be used. B.R.Wilson,
  205. Solihull
  206. 3.1
  207. •   Uncluttering catalogues (2.11 p 13 cont) − If you close down an
  208. application using the ADJUST button the filer will (re)open the viewer
  209. containing the file you last accessed.
  210. 3.1
  211. •   Using Sys$DateFormat (issue 2.12 p 19 cont) − Mark Taylor (along
  212. with several others) has answered a question which appeared in last
  213. month’s Help!!! column.
  214. 3.1
  215. The system variable Sys$DateFormat is only used by the SWI call
  216. OS_ConvertStandardDate AndTime and not by the BASIC pseudo variable
  217. TIME$ (see pp 400-402 of the old PRM for further details).
  218. 3.1
  219.  10 REM >$.Convert
  220. 3.1
  221.  20 REM a program to convert TIME &
  222. 3.1
  223.  DATE in to a string,
  224. 3.1
  225.  30 REM in the format of the system
  226. 3.1
  227. variable Sys$DateFormat
  228. 3.1
  229.  40 :
  230. 3.1
  231.  50 REM some workspace for the time
  232. 3.1
  233.  & date SYS call
  234. 3.1
  235.  60 DIM block% 100
  236. 3.1
  237.  70 :
  238. 3.1
  239.  80 *Set Sys$DateFormat
  240. 3.1
  241. %yr%mn%dy%24%mi%se
  242. 3.1
  243.  90 string$=FNtime_date
  244. 3.1
  245. 100 PRINT “The time is
  246. 3.1
  247. (YYMMDDHHMMSS) = “;string$
  248. 3.1
  249. 110 END
  250. 3.1
  251. 120 :
  252. 3.1
  253. 130 DEFFNtime_date
  254. 3.1
  255. 140 REM first get 5 byte time code
  256. 3.1
  257. 150 REM using OS_Word &0E,3
  258. 3.1
  259. 160 SYS “OS_Word”,&0E,3 TO r0,r1
  260. 3.1
  261. 170 :
  262. 3.1
  263. 180 REM get date & time string
  264. 3.1
  265. 190 SYS “OS_ConvertStandardDate
  266. 3.1
  267. AndTime“,block%,block%+50,49
  268. 3.1
  269.  TO r0,r1,r2
  270. 3.1
  271. 200 :
  272. 3.1
  273. 210 REM extract string from data
  274. 3.1
  275.  block
  276. 3.1
  277. 220 date$=“”
  278. 3.1
  279. 230 FOR x%=0 TO (12-r2)
  280. 3.1
  281. 240 data$+=CHR$(r0?x%)
  282. 3.1
  283. 250 NEXT x%
  284. 3.1
  285. 260 =date$
  286. 3.1
  287.  
  288. 3.1
  289. •   VIDC warning − Someone (Philip Green, I think) sent in a warning to
  290. say that you should NEVER connect and disconnect video and monitor
  291. connections with the computer switched on for fear of damaging the VIDC.
  292. 3.1
  293. I have been doing just that for two years now on several different
  294. Archimedes computers and have NEVER had any problems, so I wasn’t going
  295. to bother printing the warning − it seemed a little over cautious. This
  296. morning I connected up a brand new monitor, live as usual, and got a
  297. funny picture. “Drat”, says I, “It’s a DOA and will have to go back to
  298. the distributor from whence it came!” However, further fiddling and
  299. switching of monitors (live) between computers revealed that the
  300. computer was at fault − there were funny dark vertical lines down the
  301. display and the sound was a bit croaky (sound comes through VIDC). This
  302. is what you call learning the hard way or “Pride comes before a fall” or
  303. something. Anyway, don’t say we didn’t warn you! Ed.
  304. 3.1
  305. •   Hints & Tips printing error, Archive 2.12 p 7. The IF statement at
  306. line 750 is incorrect − a 7 has been cut off by the editor − ‘key% < 5’
  307. should read ‘key% <57’.
  308.